<?php
namespace Swiftx\Component\Httpd;
use Swiftx\Component\Router\Request as RequestRouter;
use Swiftx\Interfaces\Httpd\Request as RequestInterfaces;
use Swiftx\Interfaces\Httpd\Post;
use Swiftx\Interfaces\Httpd\Cookie;
use Swiftx\Interfaces\Httpd\Session;
use Swiftx\Interfaces\Httpd\Upload;

/**
 * 用户Http请求类
 * @package Swiftx\Component\Httpd
 */
class Request extends RequestRouter implements RequestInterfaces {

    /**
     * SESSION
     * @var Session
     */
    protected $session = null;

    /**
     * POST数据
     * @var Post
     */
    protected $post = null;

    /**
     * 上传文件集
     * @var Upload[]
     */
    protected $uploads = [];

    /**
     * 设置SSL支持
     * @param bool $enable
     */
    public function setSupportSSL(bool $enable = true){
        // TODO: Implement setSupportSSL() method.
    }

    /**
     * 是否支持SSL
     * @return bool
     */
    public function getSupportSSL(){
        // TODO: Implement getSupportSSL() method.
    }

    /**
     * 设置语言
     * @param string $value
     */
    public function setLanguage(string $value){
        // TODO: Implement setLanguage() method.
    }

    /**
     * 设置语言
     * @param string[] ...$value
     */
    public function setLanguages(string ...$value){
        // TODO: Implement setLanguages() method.
    }

    /**
     * 读取语言
     * @return string[]
     */
    public function getLanguages():array{
        // TODO: Implement getLanguages() method.
    }

    /**
     * 设置Cookie对象
     * @param Cookie $value
     */
    public function setCookie(Cookie $value){
        // TODO: Implement setCookie() method.
    }

    /**
     * 获取Cookie对象
     * @return Cookie
     */
    public function getCookie():Cookie{
        // TODO: Implement getCookie() method.
    }

    /**
     * 获取SESSION对象
     * @return Session
     */
    public function getSession():Session{
        return $this->session;
    }

    /**
     * 设置SESSION对象
     * @param Session $value
     */
    public function setSession(Session $value){
        $this->session = $value;
    }

    /**
     * 设置上传对象
     * @param Upload $value
     */
    public function setUpload(string $name, Upload $value){
        $this->uploads[$name] = $value;
    }

    /**
     * 获取文件上传者
     * @return Upload
     */
    public function getUpload(string $name):Upload{
        return $this->uploads[$name];
    }

    /**
     * 获取POST对象
     * @return Post
     */
    public function getPost():Post{
        return $this->post;
    }

    /**
     * 设置POST对象
     * @param Post $post
     */
    public function setPost(Post $post){
        $this->post = $post;
    }
}
